write a function solution in python

welcome to shbcf.ru